import Cookies from 'js-cookie'
import website from '@/config/website'
// const Authorization = website.Authorization
const tokenKey = 'OOO_SSO_TOKEN'
// var inFifteenMinutes = new Date(new Date().getTime() + website.tokenTime * 1000);
export function getToken () {
  return Cookies.get(tokenKey)
}

export function setToken (token) {
  const inFifteenMinutes = new Date(new Date().getTime() + 8 * 60 * 60 * 1000);
  return Cookies.set(tokenKey, token, { expires: inFifteenMinutes })
}

export function removeToken () {
  return Cookies.remove(tokenKey)
}